import request from '@/utils/request'

// 查询围栏坐标列表
export function listFence(query) {
  return request({
    url: '/app/gaode/queryFence',
    method: 'get',
    params: query
  })
}

// 检查地址
export function fenceLocation(query) {
  return request({
    url: '/app/apiService/fence/getFenceByLocation',
    method: 'get',
    params: query
  })
}

// 查询围栏坐标列表
export function checkFence(query) {
  return request({
    url: '/app/gaode/checkFence',
    method: 'get',
    params: query
  })
}

// 保存缓存
export function saveCache(data) {
  return request({
    url: '/app/gaode/saveCache',
    method: 'post',
    data: data
  })
}

export function upDataFenceName(data){
  return request({
    url: '/app/gaode/upDataFenceName',
    method: 'put',
    data: data
  })
}

export function saveFenceByQy(data) {
  return request({
    url: '/app/gaode/saveFenceByQy',
    method: 'post',
    data: data
  })
}

export function updateFence(data) {
  return request({
    url: '/app/gaode',
    method: 'put',
    data: data
  })
}


// 删除围栏坐标
export function delFence(data) {
  return request({
    url: '/app/gaode/delFence',
    method: 'post',
    data: data
  })
}
//根据地址查询围栏信息
export function queryByAddr(location) {
  return request({
    url: '/app/gaode/queryByAddr',
    method: 'get',
    params: {'location':location}
  })
}

export function getDistrict(query) {
  return request({
    url: '/app/district/queryDistrict',
    method: 'get',
    params: query
  })
}

// 查询电子围栏详细
export function getFence(id) {
  return request({
    url: '/app/fence/' + id,
    method: 'get'
  })
}

// 生成围栏坐标
export function genFencePoints(data) {
  return request({
    url: '/app/gaode/genFencePoints',
    method: 'post',
    data: data
  })
}





